


**************************************
***Tables main paper
**************************************
*global path "/users/andkje/dropbox/working_and_voting"
*global dir="$path/Replicationfiles_female_employment" 
global path "C:\Users\andrkot\Dropbox (Frischsenteret)\Working_and_Voting\"
global dir="$path/Replicationfiles_female_employment" 

cap log close 
log using  "$dir/results/log_of_results.log", replace
set scheme s1mono

global controls0="gp_totpop gp_SC gp_ST gp_M_LIT gp_F_LIT GP_primary_middle  GP_phc  GP_tapwater  GP_communication GP_paved  GP_electricity hindus_14 muslims_14 avg_elec1217"	
global controls="gp_totpop gp_SC gp_ST gp_M_LIT gp_F_LIT GP_primary_middle GP_phc  GP_tapwater  GP_communication  GP_paved  GP_electricity hindus_14 muslims_14 avg_elec1217 turnout_female14 turnout_male14"	
global cluster ac_block_id	 
eststo clear


************* Install commands **********
cap ssc install  parmest
cap ssc install carryforward
cap ssc install outtable
**************************************


**************************************
**Table 1: NREGS employment and voter turnout
**************************************
quietly {
use "$dir/data/estimation_sample.dta",clear
eststo T1c1: areg turn_female_diff ihs_NREGAdiff_female1613  , cluster($cluster ) robust a(ac_block_id)	
summarize turn_female_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "No"
estadd local lagged "No"

eststo T1c2: areg turn_female_diff ihs_NREGAdiff_female1613 $controls0 , cluster($cluster ) robust a(ac_block_id)	
summarize turn_female_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "Yes"
estadd local lagged "No"

eststo T1c3: areg turn_female_diff ihs_NREGAdiff_female1613 $controls, cluster($cluster ) robust a(ac_block_id)	
summarize turn_female_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "Yes"
estadd local lagged "Yes"

areg turn_female_diff ihs_NREGAdiff_female1613 $controls  ,cluster($cluster ) robust a(ac_block_id)	 	 

qui egen std=std(block_ec_female_ratio) 
qui gen std_inter=ihs_NREGAdiff_female1613*std 
qui xtile qun=block_ec_female_ratio,n(4)
forvalues q=1/4 {
gen Q`q'=qun==`q'
gen q`q'=ihs_NREGAdiff_female1613*Q`q'
}

eststo T1c4: areg turn_female_diff ihs_NREGAdiff_female1613 std_inter  std   $controls if  block_ec_female_ratio!=. ,cluster($cluster ) robust a(ac_block_id)	
summarize turn_female_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "Yes"
estadd local lagged "Yes"

eststo T1c5: areg turn_female_diff  ihs_NREGAdiff_female1613 q2 q3 q4    $controls if  block_ec_female_ratio!=.,cluster($cluster ) robust a(ac_block_id)	
summarize turn_female_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "Yes"
estadd local lagged "Yes"

eststo T1c6: areg turn_male_diff ihs_NREGAdiff_female1613 $controls  ,cluster($cluster ) robust a(ac_block_id)
summarize turn_male_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "Yes"
estadd local lagged "Yes"

eststo T1c7: areg turn_male_diff ihs_NREGAdiff_male1613  $controls   ,cluster($cluster ) robust a(ac_block_id)
summarize turn_male_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
estadd local controls "Yes"
estadd local lagged "Yes"

label var ihs_NREGAdiff_female1613 "IHS Female workdays"
}

noisily esttab T1c1 T1c2 T1c3 T1c4 T1c5 T1c6 T1c7, ///
	keep(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613 std_inter q2 q3 q4 ) order(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613 std_inter q2 q3 q4)  s(N r2 mean_depvar controls lagged) label nomtitles starlevels(* 0.10 ** 0.05) 



**************************************
**Table 2: Regressions based on Prillaman (2021) dataset
**************************************
quietly {
use "$dir/data/mechanism_sample.dta",clear
global CV="v_totpop2011 v_SC v_ST v_M_LIT v_F_LIT v_primary_middle  v_phc  v_tapwater  v_communication  v_paved  v_electricity"	
global c "highest_edu sc st hindu   a0-a15"
global c2 "highest_edu sc st hindu age"

tempfile temp
save `temp',replace

*Help for column 1
areg vote_panchayat ihs_NREGAdiff_female1312   $c $CV  if gender==1&age>=22 ,absorb(ac_block) cluster(panchayat)
keep if e(sample)
qui gen t=1
qui bys villagecode: egen mean_sum=sum(t)
qui bys villagecode: egen mean_vote_panchayat=mean(vote_panchayat*100)
qui bys villagecode: egen mean_vote_mla=mean(vote_mla*100)
qui gen vote_diff=mean_vote_panchayat-mean_vote_mla
foreach var in  highest_edu sc st hindu  age {
	qui bys villagecode: egen mean_`var'=mean(`var')
	replace `var'=mean_`var'
}
duplicates drop villagecode,force
gen sample_village=1
append using `temp'
gen sample_hhs=1 if sample_village==.


eststo T2c1: areg vote_diff  ihs_NREGAdiff_female1312  mean_vote_mla  $c2 $CV if sample_village==1,absorb(ac_block) robust cluster(ac_block)
summarize vote_diff  if e(sample)==1
estadd scalar mean_depvar = r(mean)

global a=1
local depvar "work_yr friends_village net_pol_N_named info_index nonvoting_index "
foreach x of local depvar {
	global a=$a +1
	eststo T2c$a: areg `x'  ihs_NREGA_female_pc1516  $c $CV  if gender==1 & sample_hhs==1,absorb(ac_block) cluster(panchayat)
	summarize `x'  if e(sample)==1
	estadd scalar mean_depvar = r(mean)
}
label var  ihs_NREGAdiff_female1312 "IHS Female workdays"
label var ihs_NREGA_female_pc1516  "IHS Female workdays, per capita"
}

noisily esttab  T2c1 T2c2 T2c3 T2c4 T2c5 T2c6, keep(ihs_NREGAdiff_female1312 ihs_NREGA_female_pc1516) order(ihs_NREGAdiff_female1312 ihs_NREGA_female_pc1516)  se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 


***************************************************		
**Table A1: Characteristics of missing observations
***************************************************	
use "$dir/data/sample_tableA1.dta",clear
matrix tabA1=J(19,2,.)
qui {
preserve
duplicates drop GP_id,force
*Panel A
global a=0
foreach sample in nrega booth estimation {
global a=$a +2
foreach v in 0 1  {
sum gp_totpop if `sample'_missing==`v'
matrix tabA1[$a,`v'+1]=r(mean)
matrix tabA1[$a +1,`v'+1]=r(N)
}
}
*Panel B
global a=$a +2
foreach var in nrega_days_female13  nrega_days_female16  nrega_days_male13 nrega_days_male16 {
global a=$a +1
foreach v in 0 1  {
sum `var' if estimation_missing==`v'
matrix tabA1[$a,`v'+1]=r(mean)
}
}
global a=$a +1
foreach v in 0 1  {
sum nrega_days_female13 if estimation_missing==`v'
matrix tabA1[$a,`v'+1]=r(N)
}
restore
*Panel C
global a=$a +1
foreach var in turnout_female14  turnout_female17  turnout_male14  turnout_male17 {
global a=$a +1
foreach v in 0 1  {
sum `var' if estimation_missing==`v'
matrix tabA1[$a,`v'+1]=r(mean)
}
}
global a=$a +1
foreach v in 0 1  {
sum turnout_female14 if estimation_missing==`v'
matrix tabA1[$a,`v'+1]=r(N)
}
matrix colnames tabA1 = "Sample" "Missing" 
matrix rownames tabA1= "Panel_A" "NREGS_sample" "N" "Polling_booth_sample" "N"  "Estimation_sample" "N"  "Panel_B" "Females_201314" "Females_201617" "Males_201314" "Males_201617" "N"  "Panel_C" "Female_turnout_2014"  "Female_turnout_2017" "Male_turnout_2014"  "Male_turnout_2017" "N" 
}

mat list tabA1




	
************************************	
**Table A2: Placebo regressions
************************************	
qui {
use "$dir/data/estimation_sample.dta",clear
eststo TA2c1: areg  turn_female_diff ihs_NREGAdiff_card1613 $controls ,cluster($cluster ) robust a(ac_block_id)
eststo TA2c2: areg  turn_female_diff ihs_NREGAdiff_female1618  $controls ,cluster($cluster ) robust a(ac_block_id)
label var ihs_NREGAdiff_female1618  "IHS Future female workdays" 
label var ihs_NREGAdiff_card1613  "IHS Job card applications" 
}

noisily esttab  TA2c1 TA2c2 ,keep(ihs_NREGAdiff_card1613  ihs_NREGAdiff_female1618) order(ihs_NREGAdiff_card1613  ihs_NREGAdiff_female1618) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 



**************************************
**Table A3: Balancing
**************************************

use "$dir/data/estimation_sample.dta",clear
qui {
matrix tabA3=J(48,1,.)
global a=0
*Panel A: Booth level variables
foreach dep in turnout_male14 turnout_female14  avg_elec1217 hindus_14 muslims_14{
global a=$a +2
egen STD=std(`dep') 
areg ihs_NREGAdiff_female1613   STD    ,cluster($cluster ) robust a(ac_block_id)
parmest, label saving("$dir/results/`dep'",replace) stars(0.1 0.05 0.01) idstr("`dep'") escal(N) idnum(1) 
matrix tabA3[$a, 1]=_b[STD]
matrix tabA3[$a +1, 1]=_se[STD]
drop STD
}
matrix tabA3[$a +2, 1]=e(N)

*Panel B: GP demographic variables
global a=$a +2
foreach dep in gp_totpop gp_SC gp_ST gp_M_LIT  gp_F_LIT   {
global a=$a +2
egen STD=std(`dep')  
areg   ihs_NREGAdiff_female1613  STD  ,cluster($cluster )  robust a(ac_block_id)
parmest, label saving("$dir/results/`dep'",replace) stars(0.1 0.05 0.01) idstr("`dep'") escal(N) idnum(1) 
matrix tabA3[$a, 1]=_b[STD]
matrix tabA3[$a +1, 1]=_se[STD]
drop STD
}
matrix tabA3[$a +2, 1]=e(N)

*Panel C: GP amenities variables
global a=$a +2
foreach dep in GP_primary_middle GP_phc GP_electricity GP_tapwater  GP_paved  GP_communication  {
global a=$a +2
egen STD=std(`dep' ) 
areg ihs_NREGAdiff_female1613  STD   ,cluster($cluster ) robust a(ac_block_id)
parmest, label saving("$dir/results/`dep'",replace) stars(0.1 0.05 0.01) idstr("`dep'") escal(N) idnum(1) 
matrix tabA3[$a, 1]=_b[STD]
matrix tabA3[$a +1, 1]=_se[STD]
drop STD
}
matrix tabA3[$a +2, 1]=e(N)


*Panel D: Other
global a=$a +1
foreach dep in  turnout12 gp_consumption  GP_ec_female_ratio  {
global a=$a +3
egen STD=std(`dep') 
areg ihs_NREGAdiff_female1613  STD    ,cluster($cluster )robust a(ac_block_id)
parmest, label saving("$dir/results/`dep'",replace) stars(0.1 0.05 0.01) idstr("`dep'") escal(N) idnum(1) 
matrix tabA3[$a, 1]=_b[STD]
matrix tabA3[$a +1, 1]=_se[STD]
matrix tabA3[$a +2, 1]=e(N)
drop STD
}
matrix colnames tabA3 = "_" 
matrix rownames tabA3= "Panel_A" "Turnout_male" "_" "Turnout_females" "_" "Eligble_voters" "_" "Hindus" "_" "Muslims" "_"   "N"  "Panel_B" "Total_population" "_" "Schedule_castes" "_" "Schedule_tribes" "_" "Male_literates" "_" "Female_literates" "_" "N" "Panel_C" "School"  "_" "Primary_health_center" "_" "Electriticity" "_" "Tap_water" "_" "Paved_roads" "_" "Bus_train_ferry" "_" "N"  "Panel_D" "Turnout_2012" "_" "N" "Avg_consumption"  "_" "N" "Female_empl_share"  "_" "N"

}

mat list tabA3

qui areg ihs_NREGAdiff_female1613 $controls ,cluster(GP_id) robust a(ac_block_id)
disp "F-stat all controls:   " e(F)

qui areg ihs_NREGAdiff_female1613 $controls turnout12 gp_consumption  GP_ec_female_ratio ,cluster(GP_id) robust a(ac_block_id)
disp "F-stat all controls and extra variables:   " e(F)



************************************	
**Table A4: Dynamics
************************************	
qui {
use "$dir/data/estimation_sample.dta",clear
eststo TA4: areg turn_female_diff ihs_NREGAdiff_female1718 ihs_NREGAdiff_female1617 ihs_NREGAdiff_female1516 ihs_NREGAdiff_female1415 ihs_NREGAdiff_female1314 ihs_NREGAdiff_female1213 ihs_NREGAdiff_female1112 $controls , cluster($cluster ) robust a(ac_block_id)
label var ihs_NREGAdiff_female1718  "IHS 2018-19" 
label var ihs_NREGAdiff_female1617  "IHS 2017-18" 
label var ihs_NREGAdiff_female1516  "IHS 2016-17" 
label var ihs_NREGAdiff_female1415  "IHS 2015-16" 
label var ihs_NREGAdiff_female1314  "IHS 2014-15" 
label var ihs_NREGAdiff_female1213  "IHS 2013-14" 
label var ihs_NREGAdiff_female1112  "IHS 2012-13" 
}

noisily esttab  TA4,keep(ihs_NREGAdiff_female1718 ihs_NREGAdiff_female1617 ihs_NREGAdiff_female1516 ihs_NREGAdiff_female1415 ihs_NREGAdiff_female1314 ihs_NREGAdiff_female1213 ihs_NREGAdiff_female1112) order(ihs_NREGAdiff_female1718 ihs_NREGAdiff_female1617 ihs_NREGAdiff_female1516 ihs_NREGAdiff_female1415 ihs_NREGAdiff_female1314 ihs_NREGAdiff_female1213 ihs_NREGAdiff_female1112) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 

	 
 
************************************		 
**Table A5: Functional form
************************************	
qui {
use "$dir/data/estimation_sample.dta",clear
eststo TA5c1: areg turn_female_diff log_NREGAdiff_female1613  $controls ,cluster($cluster ) robust a(ac_block_id)
estadd local Outliers "No"
eststo TA5c2: areg turn_female_diff simple_NREGAdiff_female1613 $controls  ,cluster($cluster ) robust a(ac_block_id)
estadd local Outliers "No"
egen d1=std(simple_NREGAdiff_female1613) if e(sample)==1
gen drop=d1>=5 |d1<=-5
eststo TA5c3: areg turn_female_diff simple_NREGAdiff_female1613 $controls  if  drop==0,cluster($cluster ) robust a(ac_block_id)
estadd local Outliers "Yes"
label var log_NREGAdiff_female1613 "Log female employment"
label var simple_NREGAdiff_female1613  "Diff female employment"
}

noisily esttab  TA5c1 TA5c2 TA5c3,keep(log_NREGAdiff_female1613 simple_NREGAdiff_female1613) order(log_NREGAdiff_female1613 simple_NREGAdiff_female1613) se s(N r2 Outliers) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 

	 
	 
************************************	
**Table A6: Robustness: alternative NREGA measures
************************************	
qui {
use "$dir/data/estimation_sample.dta",clear
eststo TA6c1: areg turn_female_diff   ihs_NREGAdiff_male1613  $controls ,cluster($cluster ) robust a(ac_block_id)
eststo TA6c2: areg turn_female_diff ihs_NREGAdiff_female1613  ihs_NREGAdiff_male1613   $controls  ,cluster($cluster ) robust a(ac_block_id)
eststo TA6c3: areg turn_male_diff ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613   $controls    ,cluster($cluster ) robust a(ac_block_id)
label var ihs_NREGAdiff_female1613 "IHS Female workdays"
label var ihs_NREGAdiff_male1613 "IHS Male workdays"
}

noisily esttab  TA6c1 TA6c2 TA6c3,keep(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613 ) order(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613  ) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 


	 
************************************	
**Table A7: Robustness: alternative NREGA measures
************************************	
qui {
use "$dir/data/estimation_sample.dta",clear
eststo TA7c1: areg turn_female_diff ihs_NREGAdiff_workers1613  $controls  ,cluster($cluster ) robust a(ac_block_id)
eststo TA7c2: areg turn_female_diff ihs_NREGAdiff_funds1613   $controls    ,cluster($cluster ) robust a(ac_block_id)
eststo TA7c3: areg turn_female_diff ihs_NREGAdiff_days1613   $controls   ,cluster($cluster ) robust a(ac_block_id)
label var ihs_NREGAdiff_workers1613  "IHS Workers" 
label var ihs_NREGAdiff_funds1613  "IHS Pay" 
label var ihs_NREGAdiff_days1613   "$IHS Workdays" 
}

noisily esttab  TA7c1 TA7c2 TA7c3,keep(ihs_NREGAdiff_workers1613 ihs_NREGAdiff_funds1613  ihs_NREGAdiff_days1613 ) order(ihs_NREGAdiff_workers1613 ihs_NREGAdiff_funds1613  ihs_NREGAdiff_days1613) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 

	 

************************************		 
**Table A8: Other robustness  
************************************	
qui {
global controls_gp="gp_totpop gp_SC gp_ST gp_M_LIT gp_F_LIT GP_primary_middle  GP_phc  GP_tapwater  GP_communication  GP_paved  GP_electricity"	
use "$dir/data/estimation_sample.dta",clear
eststo TA8c1: areg turn_female_diff ihs_NREGAdiff_female1613  $controls if  score_gp>.6 ,cluster($cluster ) robust a(ac_block_id)
eststo TA8c2: areg turn_female_diff ihs_NREGAdiff_female1613  $controls   if  score_gp>.75 ,cluster($cluster ) robust a(ac_block_id)
eststo TA8c3: areg turn_female_diff ihs_NREGAdiff_female1613  $controls   if  score_gp==1 ,cluster($cluster ) robust a(ac_block_id)
areg turn_female_diff ihs_NREGAdiff_female1613 $controls   ,cluster($cluster ) robust a(ac_block_id)
qui keep if e(sample)==1
foreach v in turn_female_diff turnout_female14 turnout_male14 hindus_14 muslims_14 avg_elec1217  {
qui bysort GP_id: egen GP_`v'=mean(`v') 
}
qui bys GP_id: egen help_mode=mode(ac_block_id)
replace ac_block_id=help_mode if help_mode!=.
bys GP_id: egen test=sd(ac_block_id)
qui bys GP_id: egen help_median=median(ac_block_id)
replace ac_block_id=help_median if test!=0
duplicates drop GP_id ,force
eststo TA8c5: areg GP_turn_female_diff ihs_NREGAdiff_female1613 GP_turnout_female14 GP_turnout_male14 GP_hindus_14 GP_muslims_14 $controls_gp  , robust a(ac_block_id) cluster(GP_id)

use "$dir/data/estimation_sample_alternative.dta",clear
global controls_alt="gp_totpop gp_SC gp_ST gp_M_LIT gp_F_LIT GP_primary_middle GP_phc  GP_tapwater  GP_communication  GP_paved  GP_electricity hindus_14 muslims_14 avg_elec1217 turnout_female14alt turnout_male14alt"	
eststo TA8c4: areg turn_female_diff_alt ihs_NREGAdiff_female1613 $controls_alt ,cluster($cluster )robust a(ac_block_id)
label var ihs_NREGAdiff_female1613 "IHS Female workdays"
}
 
noisily esttab  TA8c1 TA8c2 TA8c3 TA8c4 TA8c5,keep(ihs_NREGAdiff_female1613) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 



	 
************************************	 
**Table A9. Voting patterns
************************************	
qui {
use "$dir/data/estimation_sample.dta",clear
reg winner1212 winner1412 winner1712
keep if e(sample)
gen voting2012=.
gen voting2014=.

*Overall turnout
eststo TA9c1: areg turn_diff ihs_NREGAdiff_female1613 $controls  if e(sample), cluster($cluster ) robust a(ac_block_id)

*Party of current MLA
replace voting2012=winner1212
replace voting2014=winner1412
eststo TA9c2: areg winner1712 ihs_NREGAdiff_female1613 voting2014  voting2012 $controls  , cluster($cluster ) robust a(ac_block_id)

*Party of current MP
replace voting2012= winner1214
replace voting2014= winner1414
eststo TA9c3: areg  winner1714 ihs_NREGAdiff_female1613 voting2014  voting2012 $controls  , cluster($cluster ) robust a(ac_block_id)

*Party in majority in State Assembly, SP
replace voting2012=share_votes_sp12
replace voting2014=share_votes_sp14
eststo TA9c4: areg share_votes_sp17 ihs_NREGAdiff_female1613 voting2014  voting2012 $controls  , cluster($cluster ) robust a(ac_block_id)

*Party in majority in National Parliament, BJP
replace voting2012=share_votes_bjp12
replace voting2014=share_votes_bjp14
eststo TA9c5: areg share_votes_bjp17 ihs_NREGAdiff_female1613 voting2014  voting2012 $controls , cluster($cluster ) robust a(ac_block_id)

*INC
replace voting2012=share_votes_inc12
replace voting2014=share_votes_inc14
eststo TA9c6: areg share_votes_inc17 ihs_NREGAdiff_female1613 voting2014  voting2012 $controls , cluster($cluster ) robust a(ac_block_id)

label var ihs_NREGAdiff_female1613 "IHS Female workdays"
}

noisily esttab  TA9c1 TA9c2 TA9c3 TA9c4 TA9c5 TA9c6,keep(ihs_NREGAdiff_female1613) order(ihs_NREGAdiff_female1613) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 



************************************	 
*Table A10: "Block"-voting
************************************
qui {
use "$dir/data/estimation_sample.dta",clear
foreach v in fragmentation17 fragmentation14	{
	replace `v'=`v'*100
}
gen enop_diff=enop17-enop14	 
gen frag_diff=fragmentation17-fragmentation14	 
eststo TA10c1: areg enop_diff ihs_NREGAdiff_female1613 $controls , cluster($cluster ) robust a(ac_block_id)
summarize enop_diff if e(sample)==1
estadd scalar mean_depvar = r(mean)
eststo TA10c2: areg frag_diff ihs_NREGAdiff_female1613 $controls , cluster($cluster ) robust a(ac_block_id)
summarize frag_diff  if e(sample)==1
estadd scalar mean_depvar = r(mean)
label var ihs_NREGAdiff_female1613 "IHS Female workdays" 
}

noisily esttab  TA10c1 TA10c2 ,keep(ihs_NREGAdiff_female1613) se s(N r2 mean_depvar) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 


*******************
*Table A11, time variation Appendix
*******************
qui {
use "$dir/data/mechanism_sample.dta",clear
global CV="v_totpop2011 v_SC v_ST v_M_LIT v_F_LIT v_primary_middle  v_phc  v_tapwater  v_communication  v_paved  v_electricity"	
global c "highest_edu sc st hindu   a0-a15"
global c2 "highest_edu sc st hindu age"

*Column 1-3
qui areg vote_panchayat ihs_NREGAdiff_female1312 $c $CV  if gender==1&age>=22 ,absorb(ac_block) cluster(panchayat)
preserve
keep if e(sample)
gen t=1
bys villagecode: egen mean_sum=sum(t)
bys villagecode: egen mean_vote_panchayat=mean(vote_panchayat*100)
bys villagecode: egen mean_vote_mla=mean(vote_mla*100)
gen vote_diff=mean_vote_panchayat-mean_vote_mla
foreach var in  highest_edu sc st hindu  age {
	bys villagecode: egen mean_`var'=mean(`var')
	replace `var'=mean_`var'
}
duplicates drop villagecode,force
eststo TA11c1: areg vote_diff ihs_NREGAdiff_female1312 mean_vote_mla $CV $c2 ,absorb(ac_block) robust
eststo TA11c2: areg vote_diff ihs_NREGAdiff_cards1312 mean_vote_mla $CV $c2 ,absorb(ac_block) robust
eststo TA11c3: areg vote_diff ihs_NREGAdiff_female1413 mean_vote_mla $CV $c2 ,absorb(ac_block) robust
restore

*Column 4
areg vote_panchayat ihs_NREGAdiff_female1312   $c $CV  if gender==0&age>=22 ,absorb(ac_block) cluster(panchayat)
keep if e(sample)
gen t=1
bys villagecode: egen mean_sum=sum(t)
bys villagecode: egen mean_vote_panchayat=mean(vote_panchayat*100)
bys villagecode: egen mean_vote_mla=mean(vote_mla*100)
gen vote_diff=mean_vote_panchayat-mean_vote_mla
foreach var in  highest_edu sc st hindu  age {
	bys villagecode: egen mean_`var'=mean(`var')
	replace `var'=mean_`var'
}
duplicates drop villagecode,force
eststo TA11c4: areg vote_diff   ihs_NREGAdiff_male1312   mean_vote_mla $CV $c2 ,absorb(ac_block) robust

label var ihs_NREGAdiff_female1312 "IHS Female workdays" 
label var ihs_NREGAdiff_cards1312 "IHS Job cards" 
label var ihs_NREGAdiff_female1413  "IHS Future workdays"
label var ihs_NREGAdiff_male1312 "$IHS Male workdays" 
}

noisily esttab  TA11c1 TA11c2 TA11c3 TA11c4 ,keep(ihs_NREGAdiff_female1312 ihs_NREGAdiff_cards1312  ihs_NREGAdiff_female1413 ihs_NREGAdiff_male1312) order(ihs_NREGAdiff_female1312 ihs_NREGAdiff_cards1312  ihs_NREGAdiff_female1413 ihs_NREGAdiff_male1312) se s(N r2) label nomtitles starlevels(* 0.10 ** 0.05 *** 0.01) 



*******************
*Table A12
*******************
qui {
use "$dir/data/mechanism_sample.dta",clear
global CV="v_totpop2011 v_SC v_ST v_M_LIT v_F_LIT v_primary_middle  v_phc  v_tapwater  v_communication  v_paved  v_electricity"	
global c "highest_edu sc st hindu   a0-a15"
global c2 "highest_edu sc st hindu age"

matrix tabA12=J(22,2,.)
areg vote_panchayat ihs_NREGA_female_pc1314 $c $CV  if gender==1 & age>=21,absorb(ac_block) cluster(panchayat)
matrix tabA12[1, 1]= _b[ihs_NREGA_female_pc1314]
matrix tabA12[2, 1]= _se[ihs_NREGA_female_pc1314]
qui sum vote_panchayat if e(sample)
matrix tabA12[1, 2]= r(mean)

areg vote_mla ihs_NREGA_female_pc1213 $c $CV  if gender==1  & age>=22,absorb(ac_block) cluster(panchayat)
matrix tabA12[3, 1]= _b[ihs_NREGA_female_pc1213]
matrix tabA12[4, 1]= _se[ihs_NREGA_female_pc1213]
qui sum vote_mla  if e(sample)
matrix tabA12[3, 2]= r(mean)

global a=3
foreach v in  nonvoting_index pol_partic_gramsabha pol_partic_contactsarpanch pol_partic_applicationsarpanc pol_partic_contactblock pol_partic_applicationblock pol_partic_campaign pol_partic_motivate pol_partic_partymtg {
global a=$a +2
areg `v ' ihs_NREGA_female_pc1516 $c $CV  if gender==1,absorb(ac_block) cluster(panchayat)
matrix tabA12[$a, 1]= _b[ihs_NREGA_female_pc1516]
matrix tabA12[$a+1, 1]= _se[ihs_NREGA_female_pc1516]
qui sum `v ' if e(sample)
matrix tabA12[$a, 2]= r(mean)
}

matrix colnames tabA12 = "Coefficient"  "Mean_dep_var"
matrix rownames tabA12 = "Voted_in_local_election" "." "Voted_in_state_election" "." "Nonvoting_participation_index" "." "Attend_village_assembly_meeting" "." "Contact_Panchayat_for" "govt_benefit" "Submit_application_to_Panchayat" "for_services" "Contact_block_for_govt_benefit"  "." "Submit_application_to_block"  "for_services" "Attend_campaign_event" "." "Motivate_for_campaign" "."  "Attend_party_meeting" "." 

}
mat list tabA12, format(%9.3fc)
	

*******************
*Table A13
*******************
qui {
use "$dir/data/mechanism_sample.dta",clear
global CV="v_totpop2011 v_SC v_ST v_M_LIT v_F_LIT v_primary_middle  v_phc  v_tapwater  v_communication  v_paved  v_electricity"	
global c "highest_edu sc st hindu   a0-a15"
global c2 "highest_edu sc st hindu age"

matrix tabA13=J(24,2,.)
global a=-1
foreach v in friends_village friends_women friends_inneed_dummy net_di_N_named net_snh_N_named  net_pol_N_named  discuss_pol_family_ever discuss_pol_friends_ever mobility_index info_index efficacy_index conf_index {
global a=$a +2
areg `v ' ihs_NREGA_female_pc1516   $c $CV  if gender==1,absorb(ac_block) cluster(panchayat)
matrix tabA13[$a, 1]= _b[ihs_NREGA_female_pc1516]
matrix tabA13[$a+1, 1]= _se[ihs_NREGA_female_pc1516]
qui sum `v ' if e(sample)
matrix tabA13[$a, 2]= r(mean)
}
matrix colnames tabA13 = "Coefficient"  "Mean_dep_var"
matrix rownames tabA13 = "\#_Friends_in_village" "." "\#_Female_friends_in_village" "." "Would_go_to_friends_for_support" "." "\#_Discuss_important_matters_with" "." "\#_People_visit_in_free_time" "." "\#_Discuss_politics_with" "." "Discusses_politics_with_family" "." "Discusses_politics_with_friends" "." "Mobility_index" "." "Information_index" "." "Political_efficacy_index" "." "Confidence_index" "."

}
mat list tabA13, format(%9.3fc)

	
*******************
*Table A14
*******************
qui {
use "$dir/data/mechanism_sample.dta",clear
global CV="v_totpop2011 v_SC v_ST v_M_LIT v_F_LIT v_primary_middle  v_phc  v_tapwater  v_communication  v_paved  v_electricity"	
global c "highest_edu sc st hindu   a0-a15"
global c2 "highest_edu sc st hindu age"
	
matrix tabA14=J(36,2,.)
global a=-1
foreach v in asset_index consumption_index monthly_expen~e income_sufficiency income_suffiency1 expenditure_fast decision_index decisions_vote_respondent  decisions_gs_respondent  permission_index bargain_index  cash_in_hand bank_account_respondent asset_respondent own_land_respondent work_yr domestic_violence verbal_violence {
global a=$a +2
areg `v ' ihs_NREGA_female_pc1516   $c $CV  if gender==1,absorb(ac_block) cluster(panchayat)
matrix tabA14[$a, 1]= _b[ihs_NREGA_female_pc1516]
matrix tabA14[$a+1, 1]= _se[ihs_NREGA_female_pc1516]
qui sum `v ' if e(sample)
matrix tabA14[$a, 2]= r(mean)
}
matrix colnames tabA14 = "Coefficient"  "Mean_dep_var"
matrix rownames tabA14 = "Assets_index" "." "Consumption_index" "." "Monthly_household_expenditure"  "." "Income_sufficiency" "."  "Food_Security" "."  "Time_to_save_Rs_400" "." "Decision-making_index" "." "Decide:Whom_to_vote_for" "." "Decide:_Gram_Sabha_attendance" "." "Permission_index" "." "Bargaining_power_index" "." "Personally_holds_cash" "." "Personally_has_bank_account" "." "Personally_owns_assets" "." "Personally_owns_land" "." "Employed_in_past_year" "." "Domestic_violence_index" "." "Verbal_abuse_index" "." 

}
mat list tabA14, format(%9.3fc)


cap log close	


*********************************************
***Figure 1: Employment shares outside MGNREGA
*********************************************
qui {
use "$dir/data/sample_figure1.dta",clear
sum paidwork_ex if NREGA==0 & sex==1 [weight=l1]
local men_nonrega=r(mean)
sum paidwork_ex if NREGA==1 & sex==1 [weight=l1]
local men_nrega=r(mean)
sum paidwork_ex if NREGA==0 & sex==2 [weight=l1]
local women_nonrega=r(mean)
sum paidwork_ex if NREGA==1 & sex==2 [weight=l1]
local women_nrega=r(mean)

clear
set obs 4
gen t=1
gen no=sum(t)
gen nrega=no<=2
gen female=no==1|no==3
expand 2
bysort no: gen no2=sum(t)

gen work1=`men_nonrega' if female==0 & nrega==0
gen work2=`men_nrega' if female==0 & nrega==1
replace work1=`women_nonrega' if female==1 & nrega==0
replace work2=`women_nrega' if female==1 & nrega==1
gen Group=1 if female==0 
replace Group=2 if female==1
}
graph bar work1 work2 , over(Group,  relabel(1 "Men"  2 "Women" )) legend(label(1 "Non-NREGS workers" ))  legend(label(2 "NREGS workers" ))  yscale(range(0(.1).7) ) ylabel(0(.1).7) 
graph export "$dir/results/figure1.pdf",replace


***************************************************		
**Figure A4: Distribution of changes in female workdays and job cards applications
***************************************************	
use "$dir/data/estimation_sample.dta",clear

qui {
tab ac_block_id,gen(fe_)
reg  ihs_NREGAdiff_female1613 fe_*
predict ihs_diff_hat,res
reg ihs_NREGAdiff_card1613  fe_*
predict ihs_card_diff_hat,res

twoway  histogram ihs_diff_hat ,color(gray)  bin(100) percent legend(label( 1 "Female workdays")) || histogram ihs_card_diff_hat,  bin(100) percent color(red%30) legend(label( 2 "Job card applications"))  xtitle("IHS changes") ytitle("Percent of Gram Panchayats") xscale(range(-4(1)4))
}
graph export "$dir/results/figureA4.pdf",replace




************************************	
*** Write tables to LaTex ***

*Table 1	
quietly {	
#delimit;
esttab  T1c1 T1c2 T1c3 T1c4 T1c5 T1c6 T1c7 using "$dir/results/table1",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 controls lagged mean_depvar , 
		labels(
			"Observations" 
			"R-squared"
			"Controls"
			"Lagged turnout"
			"Mean dep. var" 	
		) 
		layout(
			"@" 
			"@" 
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ Female turnout" 	"$\Delta$ Male turnout" 
		, pattern(1 0 0 0 0 1 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613 std_inter q2 q3 q4) order(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613 std_inter q2 q3 q4)
    varlabels(
		ihs_NREGAdiff_female1613 "$\Delta$ IHS(\textit{Female workdays})"
		ihs_NREGAdiff_male1613  "$\Delta$ IHS(\textit{Male workdays})"
		std_inter "\ \  $\times$ female worker share (std) "
		q2 "$\ \  \times$ female worker share, quartile=2"
		q3 "$\ \  \times$ female worker share, quartile=3"
		q4 "$\ \  \times$ female worker share, quartile=4"
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr
}
		
	
*Table 2
quietly {	
#delimit;
esttab  T2c1 T2c2 T2c3 T2c4 T2c5 T2c6 using "$dir/results/table2",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 mean_depvar , 
		labels(
			"Observations" 
			"R-squared"
			"Mean dep. var" 	
		) 
		layout(
			"@" 
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"\specialcell{$\Delta$ Female \\ turnout}" "\specialcell{Worked \\ last year \\ (0-1)}"  "\specialcell{\#Friends \\ in\\ village}"  "\specialcell{\#Discuss \\ politics \\ with}" "\specialcell{Political \\ knowledge \\ (0-9)}" "\specialcell{Nonvoting \\ partici-\\ pation \\ (0-8)}"
		, pattern(1 1 1 1 1 1) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
	)
	
	keep(ihs_NREGAdiff_female1312 ihs_NREGA_female_pc1516 ) order(ihs_NREGAdiff_female1312 ihs_NREGA_female_pc1516 )
    varlabels(
		ihs_NREGAdiff_female1312 "$\Delta$ IHS(\textit{Female workdays})"
		ihs_NREGA_female_pc1516  "$\Delta$ IHS(\textit{Female workdays, per capita})"

	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr
}
	

	
*Table A2
quietly {	
#delimit;
esttab  TA2c1 TA2c2 using "$dir/results/tableA2",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 , 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ Female turnout"
		, pattern(1 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_card1613  ihs_NREGAdiff_female1618) order(ihs_NREGAdiff_card1613  ihs_NREGAdiff_female1618)
    varlabels(
		ihs_NREGAdiff_card1613   "$\Delta \text{IHS}(Job \ card \ applications)$" 
		ihs_NREGAdiff_female1618  "$\Delta \text{IHS}(Future \ female \ workdays)$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr
}
	
	
*Table A3
		use "$dir/results/turnout_male14", clear
		foreach Y in  turnout_female14  avg_elec1217 hindus_14 muslims_14 gp_totpop gp_SC gp_ST gp_M_LIT  gp_F_LIT GP_primary_middle GP_phc GP_electricity GP_tapwater  GP_paved  GP_communication turnout12 gp_consumption  GP_ec_female_ratio {
			append using "$dir/results/`Y'"
			erase "$dir/results/`Y'.dta"
		}
		erase "$dir/results/turnout_male14.dta"
	* Keep the output of interest
		keep if parm =="STD"
		gen o1=es_1 if idstr=="turnout_male14"
		gen o2=es_1 if idstr=="gp_totpop"
		gen o3=es_1 if idstr=="GP_primary_middle"
		gen o4=es_1 if idstr=="turnout12"
		gen o5=es_1 if idstr=="gp_consumption"
		gen o6=es_1 if idstr=="GP_ec_female_ratio"
		forvalues o=1/6 {
			egen obs`o'=max(o`o')
			drop o`o'
		}
	drop es_1
		
* PREPARE THE OUTPUT OF INTEREST
	* Prepare the coefficients and standard errors	
		rename stderr se
		foreach Y of var se estimate {
			replace `Y' = round(`Y', .0001) 
			tostring `Y', gen(`Y'_st) force		
			replace `Y'_st = `Y'_st + "0"  if strlen(`Y'_st) == 4 & strmatch(`Y'_st, "*.*") & !strmatch(`Y'_st, "-*") & `Y'<1
			replace `Y'_st = `Y'_st + "00" if strlen(`Y'_st) == 3 & strmatch(`Y'_st, "*.*") & !strmatch(`Y'_st, "-*") & `Y'<1
			replace `Y'_st = `Y'_st + "0"  if strlen(`Y'_st) == 5 & strmatch(`Y'_st, "*.*") &  strmatch(`Y'_st, "-*") & `Y'<1
			replace `Y'_st = `Y'_st + "00" if strlen(`Y'_st) == 4 & strmatch(`Y'_st, "*.*") &  strmatch(`Y'_st, "-*") & `Y'<1
			}
			replace se_st = "("+se_st+")"
		
* EXPORT THE TABLE
	keep estimate_st se_st stars obs* label idstr idnum parm 
	rename estimate_st b_st
	reshape wide b_st se_st stars obs*, i(idstr) j(idnum) 
	expand 2, generate(expanded)
	gen col1 = b_st1 if expanded ==0
	replace col1  = se_st1 if expanded ==1
	gen col2 = stars	if expanded ==0
	drop b_st1 se_st1 stars1

	* add lines:
	local new = _N + 13
	set obs `new'
	replace label = "Panel A: Polling both variables 2014" if _n ==_N
	replace label = "Panel B: Census demographics 2011" if _n ==_N-1
	replace label = "Panel C: Census amenities 2011" if _n ==_N-2
	replace label = "Panel D: Other variables" if _n ==_N-3
	replace label = "\midrule" if _n ==_N-4
	replace label = "\midrule" if _n ==_N-5
	replace label = "\midrule" if _n ==_N-6
	replace label = "Number of observations" if _n ==_N-7
	replace label = "Number of observations" if _n ==_N-8
	replace label = "Number of observations" if _n ==_N-9
	replace label = "Number of observations" if _n ==_N-10
	replace label = "Number of observations" if _n ==_N-11
	replace label = "Number of observations" if _n ==_N-12
	
	carryforward obs*, replace
	forvalues o=1/6 {
		tostring obs`o'1, gen(N`o'_st) force	
		replace col1 = N`o'_st if label ==  "Number of observations"  & _n ==_N-(6+`o')
	}
	gen col = col1 + col2
	drop col1 col2
	
	* Order the lines	
	gen order = 1      if label=="Panel A: Polling both variables 2014" 
	replace order = 2  if idstr=="turnout_male14" 	&exp==0
	replace order = 3  if idstr=="turnout_male14"	&exp==1
	replace order = 4  if idstr=="turnout_female14"	&exp==0
	replace order = 5  if idstr=="turnout_female14"	&exp==1
	replace order = 6  if idstr=="avg_elec1217" 	&exp==0
	replace order = 7  if idstr=="avg_elec1217" 	&exp==1
	replace order = 8  if idstr=="hindus_14" 		&exp==0
	replace order = 9  if idstr=="hindus_14" 		&exp==1
	replace order = 10  if idstr=="muslims_14"		&exp==0
	replace order = 11  if idstr=="muslims_14"		&exp==1
	replace order = 12  if label == "Number of observations" & _n ==_N-7
	replace order = 13  if label == "\addlinespace \midrule \addlinespace" & _n ==_N-4
	replace order = 14 if label=="Panel B: Census demographics 2011"
	replace order = 15  if idstr=="gp_totpop"		&exp==0
	replace order = 16  if idstr=="gp_totpop"		&exp==1
	replace order = 17  if idstr=="gp_SC"			&exp==0
	replace order = 18  if idstr=="gp_SC"			&exp==1
	replace order = 19  if idstr=="gp_ST" 			&exp==0
	replace order = 20  if idstr=="gp_ST" 			&exp==1
	replace order = 21  if idstr=="gp_M_LIT" 		&exp==0
	replace order = 22  if idstr=="gp_M_LIT" 		&exp==1
	replace order = 23  if idstr=="gp_F_LIT"		&exp==0
	replace order = 24  if idstr=="gp_F_LIT"		&exp==1
	replace order = 25  if label == "Number of observations" & _n ==_N-8
	replace order = 26  if label == "\addlinespace \midrule \addlinespace" & _n ==_N-5
	replace order = 27 if label=="Panel C: Census amenities 2011"
	replace order = 28  if idstr=="GP_primary_middle"	&exp==0
	replace order = 29  if idstr=="GP_primary_middle"	&exp==1
	replace order = 30  if idstr=="GP_phc"				&exp==0
	replace order = 31  if idstr=="GP_phc"				&exp==1
	replace order = 32  if idstr=="GP_electricity" 		&exp==0
	replace order = 33  if idstr=="GP_electricity" 		&exp==1
	replace order = 34  if idstr=="GP_tapwater" 		&exp==0
	replace order = 35  if idstr=="GP_tapwater" 		&exp==1
	replace order = 36  if idstr=="GP_paved"			&exp==0
	replace order = 37  if idstr=="GP_paved"			&exp==1
	replace order = 38  if idstr=="GP_communication"	&exp==0
	replace order = 39  if idstr=="GP_communication"	&exp==1
	replace order = 40  if label == "Number of observations" & _n ==_N-9
	replace order = 41  if label == "\addlinespace \midrule \addlinespace" & _n ==_N-6
	replace order = 42 if label=="Panel D: Other variables"
	replace order = 43  if idstr=="turnout12"			&exp==0
	replace order = 44  if idstr=="turnout12"			&exp==1
	replace order = 45 if label == "Number of observations"& _n ==_N-10
	replace order = 46  if idstr=="gp_consumption"		&exp==0
	replace order = 47  if idstr=="gp_consumption"		&exp==1
	replace order = 48 if label == "Number of observations"& _n ==_N-11
	replace order = 49  if idstr=="GP_ec_female_ratio" 	&exp==0
	replace order = 50  if idstr=="GP_ec_female_ratio" 	&exp==1
	replace order = 51 if label == "Number of observations"& _n ==_N-12
	sort order 	
		
	* Label the variables
	replace label = "Turnout rate males"  if idstr=="turnout_male14"
	replace label = "Turnout rate females"  if idstr=="turnout_female14"
	replace label = "Eligible voters"  if idstr=="avg_elec1217" 
	replace label = "Hindus"  if idstr=="hindus_14" 
	replace label = "Muslims" if idstr=="muslims_14"
	replace label = "Total population"  if idstr=="gp_totpop"
	replace label = "Schedule caste"  if idstr=="gp_SC"
	replace label = "Schedule tribes"  if idstr=="gp_ST"
	replace label = "Male literates"  if idstr=="gp_M_LIT" 
	replace label = "Female literates"  if idstr=="gp_F_LIT" 
	replace label = "School (grade 1 to 8)"  if idstr=="GP_primary_middle" 
	replace label = "Primary health center" if idstr=="GP_phc"
	replace label = "Electricity" if idstr=="GP_electricity"
	replace label = "Tap water" if idstr=="GP_tapwater"
	replace label = "Paved road" if idstr=="GP_paved"
	replace label = "Bus, train or ferry" if idstr=="GP_communication"
	replace label = "Turnout rate 2012 (booth)" if idstr=="turnout12"
	replace label = "Average per capita consumption 2013 (GP)" if idstr=="gp_consumption"
	replace label = "Female employment share (GP)" if idstr=="GP_ec_female_ratio"
	replace label = "" if label[_n] == label[_n-1]
	replace label = "" if label=="\midrule"
	
	* Create the table
	gen end = "\\" 
	keep label col end
	forvalues i = 1/1{
		gen A`j' = "&" if label!="\addlinespace \midrule \addlinespace"
	}
	order _all, seq
	order label, first
	order end, last 
	export delimited using "$dir/results/tableA3.tex", delimiter(tab) novarnames nolabel replace

	
*Table A4
quietly {	
#delimit;
esttab  TA4 using "$dir/results/tableA4",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 , 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"\specialcell{$\Delta$ Female turnout \\ 2014 to 2017}" 
		, pattern(1 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1718 ihs_NREGAdiff_female1617 ihs_NREGAdiff_female1516 ihs_NREGAdiff_female1415 ihs_NREGAdiff_female1314 ihs_NREGAdiff_female1213 ihs_NREGAdiff_female1112)
    varlabels(
			ihs_NREGAdiff_female1718  "{  \    } $\Delta\text{2018-19}$" 
			ihs_NREGAdiff_female1617  "{  \    } $\Delta\text{2017-18}$" 
			ihs_NREGAdiff_female1516  "{  \    } $\Delta\text{2016-17}$" 
			ihs_NREGAdiff_female1415  "{  \    } $\Delta\text{2015-16}$" 
			ihs_NREGAdiff_female1314  "{  \    } $\Delta\text{2014-15}$" 
			ihs_NREGAdiff_female1213  "{  \    } $\Delta\text{2013-14}$" 
			ihs_NREGAdiff_female1112  "{  \    } $\Delta\text{2012-13}$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr
}


*Table A5
#delimit;
esttab  TA5c1 TA5c2 TA5c3  using "$dir/results/tableA5",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(5) se(5)  nomtitles s(N  r2 Outliers, 
		labels(
			"Observations" 
			"R-squared"
			"Removing outliers"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ Female turnout" 
		, pattern(1 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(log_NREGAdiff_female1613 simple_NREGAdiff_female1613) order(log_NREGAdiff_female1613 simple_NREGAdiff_female1613)
    varlabels(
			log_NREGAdiff_female1613  "$\Delta \text{Log}(Female \ workdays+1)$" 
			simple_NREGAdiff_female1613  "$\Delta Female \ workdays$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr



*Table A6
#delimit;
esttab  TA6c1 TA6c2 TA6c3  using "$dir/results/tableA6",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 , 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ Female turnout"  "$\Delta$ Male turnout" 
		, pattern(1 0 1) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613 ) order(ihs_NREGAdiff_female1613 ihs_NREGAdiff_male1613)
    varlabels(
			ihs_NREGAdiff_female1613 "$\Delta \text{IHS}(Female \ workdays)$"
			ihs_NREGAdiff_male1613  "$\Delta \text{IHS}(Male \ workdays)$"
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr


*Table A7
#delimit;
esttab  TA7c1 TA7c2 TA7c3  using "$dir/results/tableA7",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 , 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ Female turnout"  
		, pattern(1 0 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_workers1613 ihs_NREGAdiff_funds1613  ihs_NREGAdiff_days1613) order(ihs_NREGAdiff_workers1613 ihs_NREGAdiff_funds1613  ihs_NREGAdiff_days1613)
    varlabels(
			ihs_NREGAdiff_days1613  "$\Delta \text{IHS}(Workdays)$" 
			ihs_NREGAdiff_workers1613  "$\Delta \text{IHS}(Workers)$" 
			ihs_NREGAdiff_funds1613  "$\Delta \text{IHS}(Pay)$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr


*Table A8
#delimit;
esttab  TA8c1 TA8c2 TA8c3 TA8c4 TA8c5  using "$dir/results/tableA8",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)   s(N  r2 , 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
		mtitles("\specialcell{Min match \\ score$>$.60}" "\specialcell{Min match \\ score$>$.75}" "\specialcell{Full \\ match}" "\specialcell{Alternative \\ turnout rate}" "\specialcell{Collapsed \\ to GPs}" )		
	mgroups(
		"$\Delta$ Female turnout"  
		, pattern(1 0 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1613) 
    varlabels(
			ihs_NREGAdiff_female1613 "$\Delta \text{IHS}(Female \ workdays)$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr


*Table A9
#delimit;
esttab  TA9c1  TA9c2  TA9c3  TA9c4  TA9c5  TA9c6 using "$dir/results/tableA9",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)   s(N  r2, 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
		mtitles("" "\specialcell{Current \\ MLAs}" "\specialcell{Current \\ MPs}" "\specialcell{SP}" "\specialcell{BJP}" "\specialcell{INC}" )		
	mgroups(
		"\specialcell{$\Delta$ Total \\ turnout}" "$\Delta$ Vote shares for political parties"  
		, pattern(1 1 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1613)
    varlabels(
			ihs_NREGAdiff_female1613 "$\Delta \text{IHS}(Female \ workdays)$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr


*Table A10
#delimit;
esttab  TA10c1  TA10c2  using "$dir/results/tableA10",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2 mean_depvar, 
		labels(
			"Observations" 
			"R-squared"
			"Mean dep. var" 
		) 
		layout(
			"@" 
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ ENOP" "$\Delta$ (100-HH)"  
		, pattern(1 1 0) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1613) 
    varlabels(
			ihs_NREGAdiff_female1613"$\Delta \text{IHS}(Female \ workdays)$" 
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr



*Table A11
#delimit;
esttab  TA11c1 TA11c2 TA11c3 TA11c4 using "$dir/results/tableA11",
	starlevels(* 0.10 ** 0.05 *** 0.01) style(tex) booktabs  b(3) se(3)  nomtitles s(N  r2, 
		labels(
			"Observations" 
			"R-squared"
		) 
		layout(
			"@" 
			"@" 
		)
		fmt(%10.0fc 3 3 3 3 3 3 3 3 3 3 )
	)  
	mgroups(
		"$\Delta$ Female turnout"  "$\Delta$ Male turnout" 
		, pattern(1 0 0 1) 
		prefix(\multicolumn{@span}{c}{) 
		suffix(}) 
		span 
		erepeat(\cmidrule(lr){@span})
	)
	
	keep(ihs_NREGAdiff_female1312 ihs_NREGAdiff_cards1312  ihs_NREGAdiff_female1413 ihs_NREGAdiff_male1312) order(ihs_NREGAdiff_female1312 ihs_NREGAdiff_cards1312  ihs_NREGAdiff_female1413 ihs_NREGAdiff_male1312)
    varlabels(
			ihs_NREGAdiff_female1312 "$\Delta \text{IHS}(Female \ workdays)$"
			ihs_NREGAdiff_cards1312 "$\Delta \text{IHS}(Job \ cards \ applications)$" 
			ihs_NREGAdiff_female1413 "$\Delta \text{IHS}(Future \ workdays)$"
			ihs_NREGAdiff_male1312 "$\Delta \text{IHS}(Male \ workdays)$"
	)
    prehead("\begin{tabular}{l*{10}{c}}" "\toprule") 
    postfoot("\bottomrule" "\end{tabular}")
    replace;
#delimit cr


outtable using "$dir/results/tableA1", replace mat(tabA1)  nobox caption("Characteristics of missing observations") f(%11.1f   %11.1f     )	
outtable using "$dir/results/tableA12", replace mat(tabA12)  nobox caption("Political participation (Table 2 in Prillaman, 2021)") f(%11.3f   %11.3f     )	 
outtable using "$dir/results/tableA13", replace mat(tabA13)  nobox caption("Resources and Intra-household Bargaining (Table 5 in Prillaman, 2021)")  f(%11.3f   %11.3f     )
outtable using "$dir/results/tableA14", replace mat(tabA14)  nobox caption("Resources and Intra-household Bargaining (Table 5 in Prillaman, 2021)")  f(%11.3f   %11.3f     )
	


	
